<template>
  <div class="taskList">

   

    
    <div v-for="(task,index) in featureServices" :key="index" class="layer-arguments">
      <div v-bind:class="{active:index==ins}">
        <i class="kfb-icon-kehuxinxiliebiao" style="color:#337fe5;"></i>
        <span style="font-size: 14px;">&nbsp;&nbsp;{{task.name}}</span>
        <!-- <a class="kfb-icon-kehuxinxiliebiao">&nbsp;&nbsp;{{editLayer.name}}</a> -->
        <div style="float:right;margin-right: 10px">
          <el-button type="primary" icon="el-icon-edit" circle @click="editLayerBtn(index,task)" :disabled="task.status===1"></el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {mapState} from 'vuex';
  export default {
    data() {
      return {
        ins: -1
      };
    },
    methods: {
      editLayerBtn(index,task) {
        this.ins = index;
        this.$store.dispatch('xcgl/RequestFeatureFromTask',task);
      }
    },
    computed: {
      ...mapState({
        featureServices(state) {
          return state.xcgl.featureService;
        }
      })
    }
  };
</script>

<style>
  .taskList {
    min-height: 100px;
  }

  .taskList .layer-arguments {
    margin-top: 4px;
    height: 28px;
    line-height: 28px;
    border-bottom: 1px solid #eee;
    margin-left: 5px;
  }

  .taskList .layer-arguments:hover {
    background-color: #f5f7fa;
  }

  .taskList .layer-arguments a {
    font-size: 12px;
    /* color: #337fe5; */
    color: #333;
    font-family: "Helvetica Neue";
  }

  .taskList .el-button.is-circle {
    padding: 2px;
  }

  .taskList .el-button {
    font-size: 12px;
  }

  .taskList .active {
    background-color: #d9e9ff;
    color: #409eff;
  }
</style>


